<!doctype html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="referrer" content="no-referrer" />
        <link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
              crossorigin="anonymous">
        <link rel="stylesheet" th:href="@{/css/global.css}"/>
        <title>牛客网-个人主页</title>
    </head>
    <body>
        <div class="nk-container">
            <!-- 头部 -->
            <div th:replace="~{index::headerMark}"></div>

            <!-- 内容 -->
            <div class="main">
                <div class="container">
                    <!-- 选项 -->
                    <div class="position-relative">
                        <ul class="nav nav-tabs">
                            <li class="nav-item">
                                <span class="nav-link active">个人信息</span>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" th:href="@{|/user/myPost/${user.id}|}">个人帖子</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" th:href="@{|/user/myReply/${user.id}|}">个人回复</a>
                            </li>
                        </ul>
                    </div>
                    <!-- 个人信息 -->
                    <div class="media mt-5">
                        <img th:src="${user.headerUrl}" class="align-self-start mr-4 rounded-circle"
                             alt="用户头像" style="width:50px;">
                        <div class="media-body">
                            <h5 class="mt-0 text-warning">
                                <span th:text="${user.username}">nowcoder</span>
                                <input type="hidden" id="entityId" th:value="${user.id}">
                                <a th:href="@{/index}"
                                   class="btn btn-info btn-sm float-right mr-5">返回首页
                                </a>
                                <button type="button"
                                        th:class="|btn ${hasFollowed?'btn-secondary':'btn-info'} btn-sm float-right mr-4 follow-btn|"
                                        th:if="${loginUser!=null&&loginUser.id!=user.id}"
                                        th:text="${hasFollowed?'已关注':'关注TA'}">关注TA
                                </button>

                            </h5>
                            <div class="text-muted mt-3">
                                <span>注册于 <i class="text-muted"
                                             th:text="${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}">2015-06-12 15:20:12</i></span>
                            </div>
                            <div class="text-muted mt-3 mb-5">
                                <span>关注了 <a class="text-primary" th:href="@{|/followees/${user.id}|}"
                                             th:text="${followeeCount}">5</a> 人</span>
                                <span class="ml-4">关注者 <a class="text-primary" th:href="@{|/followers/${user.id}|}"
                                                          th:text="${followerCount}">123</a> 人</span>
                                <span class="ml-4">获得了 <i class="text-danger"
                                                          th:text="${userLikeCount}">87</i> 个赞</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 尾部 -->
            <div th:replace="~{index::footerMark}"></div>
        </div>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
                crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
                crossorigin="anonymous"></script>
        <script th:src="@{/js/global.js}"></script>
        <script th:src="@{/js/profile.js}"></script>
    </body>
</html>
